package com.joker.controller;

import com.joker.pojo.Group;
import com.joker.service.GroupService;
import com.joker.utily.MYbatisutil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

@Controller
@RequestMapping("/group")
public class GroupController {
    @Autowired
    @Qualifier("GroupServiceImpl")
    private GroupService groupService;
    @RequestMapping("/selectall")
    @ResponseBody
    public List<Group> selectall(){
        ArrayList<Group> ret;
        ret=groupService.selectall();
        System.out.println(ret);
       return  ret;

    }
    @RequestMapping("/select")
    @ResponseBody
    public Group select() throws IOException {
        Group ret;
//        ret=groupService.selectid(123456);
        //用自定义dao层的方法
        ret=MYbatisutil.selectid(123456);
        System.out.println(ret);
        return  ret;

    }
}
